package com.project.biz;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.project.entity.CmsUserAddress;
import com.project.pojo.model.UserAddressAddOrEditModel;

import java.util.List;

/**
 * @Description: 地址管理业务层接口类
 * @Author: zhuchi
 * @CreateDate: 2020/10/15 1:49
 * @Version: 1.0
 */
public interface CmsUserAddressBiz extends IService<CmsUserAddress> {

    /**
     * 根据用户ID分页获取收货地址
     * @param pageNo
     * @param pageSize
     * @param userId
     * @return
     */
    IPage<CmsUserAddress> getAddress(int pageNo, int pageSize, Long userId);

    /**
     * 根据用户ID获取收货地址
     * @param userId
     * @return
     */
    List<CmsUserAddress> getAddress(Long userId);

    /**
     * 获取用户默认收货地址
     * @param userId
     * @return
     */
    CmsUserAddress getDefaultAddress(Long userId);

    /**
     * 新增/修改收货地址
     * @param addOrEditDTO
     * @return
     */
    Long addOrEditAddress(UserAddressAddOrEditModel addOrEditDTO);

}
